﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// App_UserDevice数据模型对象
    /// </summary>
    [Serializable]
    public partial class App_UserDeviceMod
    {
        /// <summary>
        /// 初始化App_UserDevice数据模型对象
        /// </summary>
        public App_UserDeviceMod()
        {
            
        }
        /// <summary>
        /// 初始化App_UserDevice数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="userId">UserId</param>
        /// <param name="deviceNo">DeviceNo</param>
        /// <param name="devName">DevName</param>
        public App_UserDeviceMod(string userId,string deviceNo,string devName)
        {
            //给UserId字段赋值
            this.UserId = userId;
            //给DeviceNo字段赋值
            this.DeviceNo = deviceNo;
            //给DevName字段赋值
            this.DevName = devName;
        }
        
		//属性存储数据的变量
        private string _userId;
        private string _deviceNo;
        private string _devName;
        
        /// <summary>
        /// UserId
        /// </summary>
        public string UserId
        {
            get { return this._userId; }
            set { this._userId = value; }
        }
        /// <summary>
        /// DeviceNo
        /// </summary>
        public string DeviceNo
        {
            get { return this._deviceNo; }
            set { this._deviceNo = value; }
        }
        /// <summary>
        /// DevName
        /// </summary>
        public string DevName
        {
            get { return this._devName; }
            set { this._devName = value; }
        }
        
        /// <summary>
        /// 对比两个App_UserDevice数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的App_UserDevice数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成App_UserDevice数据模型对象
            App_UserDeviceMod app_UserDeviceMod = obj as App_UserDeviceMod;
            //判断是否转换成功
            if (app_UserDeviceMod == null) return false;
            //进行匹配属性的值
            return
                //判断UserId是否一致
                this.UserId == app_UserDeviceMod.UserId &&
                //判断DeviceNo是否一致
                this.DeviceNo == app_UserDeviceMod.DeviceNo &&
                //判断DevName是否一致
                this.DevName == app_UserDeviceMod.DevName;
        }
        /// <summary>
        /// 将当前App_UserDevice数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将App_UserDevice数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将UserId进行按位异或运算处理
                (this.UserId == null ? 2147483647 : this.UserId.GetHashCode()) ^
                //将DeviceNo进行按位异或运算处理
                (this.DeviceNo == null ? 2147483647 : this.DeviceNo.GetHashCode()) ^
                //将DevName进行按位异或运算处理
                (this.DevName == null ? 2147483647 : this.DevName.GetHashCode());
        }
        /// <summary>
        /// 将当前App_UserDevice数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前App_UserDevice数据模型对象转换成字符串副本
            return
                "[" +
                //将UserId转换成字符串
                this.UserId + "," +
                //将DeviceNo转换成字符串
                this.DeviceNo + "," +
                //将DevName转换成字符串
                this.DevName +
                "]";
        }
    }
}
